import { Tools } from 'weaver-mobile';
import { catchApiError, PARAMS } from '../util/index';

/**************************主题审批 *******************************/
//协作 - 主题审批 - 列表
export const getCoworkList = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/base/getCoworkList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

//协作 - 主题审批 - 批准、批量批准
export const batchCoworkItemApprove = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/itemMonitor/batchCoworkItemApprove',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

//协作 - 主题审批 - 批量删除
export const batchCoworkItemMonitorDel = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/itemMonitor/batchCoworkItemMonitorDel',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

/**************************内容审批 *******************************/
//协作 - 内容审批 - 列表
export const getCoworkDiscussApprovalList = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/discussApproval/getCoworkDiscussApprovalList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

//协作 - 内容审批 - 批准、批量批准
export const batchDiscussApprove = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/discussApproval/batchDiscussApprove',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

//协作 - 内容审批 - 批量删除
export const batchDiscussDel = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/discussApproval/batchDiscussDel',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}